/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function iniciarPaginaViewFolder(){
    var x;
    x=$(document);
    x.ready(inicializarEventosViewFolder);
}

function inicializarEventosViewFolder(){
    scroller=$("#viewFolderForm\\:relatedSearchsPanel");
    botonera_scroller_anchor = scroller.offset().top;
    $(window).scroll(function(){
       fixRightColumn(scroller,botonera_scroller_anchor);
    });
    
}

function fixRightColumn(scroller,botonera_scroller_anchor){
    if($(this).scrollTop() >= botonera_scroller_anchor && scroller.css('position') != 'fixed'){
            scroller.css({
                'position': 'fixed',
                'top': '0px',
                'z-index':'4'
            });
        }
    else if($(this).scrollTop() < botonera_scroller_anchor && scroller.css('position') != 'relative'){
            scroller.css({
                'position': 'relative'
            });
        }
}